#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/list.h>
#include <asm/uaccess.h>
#include <linux/udp.h>
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include "Definitii.h"

/*Rutina de cleanup */

void proc_cleanup(void)
{
    struct list_head *p, *q;
    struct regula_firewall *a_rule;
    nf_unregister_hook(&nfho);
    nf_unregister_hook(&nfho_out);
    printk(KERN_INFO "lista de reguli goala\n");
    list_for_each_safe(p, q, &regula.list) 
	{
        printk(KERN_INFO "libera\n");
        a_rule = list_entry(p, struct regula_firewall, list);
        list_del(p);
        kfree(a_rule);
    }
    remove_proc_entry(PROCF_NAME, NULL);
    printk(KERN_INFO "modul kernel indepartat.\n");
}